<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta http-equiv="Content-Type">
		<meta content="text/html; charset=utf-8">
		<meta charset="utf-8">
		<title>G4弹幕电视</title>		
		<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
		<!-- 删除默认的苹果工具栏和菜单栏 -->  
    	<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="format-detection" content="telephone=no">
		<meta name="format-detection" content="email=no">
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/main-chat2.css" />
		
		 <link rel="stylesheet" href="{$_C.hy_path}css/swiper.min.css">
		     <style>
    html, body {
        position: relative;
        height: 100%;
    }
    body {
        background: #eee;
        font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
        font-size: 14px;
        color:#000;
        margin: 0;
        padding: 0;
    }
    .swiper-container {
        width: 100%;
    
        margin-left: auto;
        margin-right: auto;
    }
    .swiper-slide {
        text-align: center;
        font-size: 18px;
        background: #fff;

        /* Center slide text vertically */
        display: -webkit-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        -webkit-justify-content: center;
        justify-content: center;
        -webkit-box-align: center;
        -ms-flex-align: center;
        -webkit-align-items: center;
        align-items: center;
    }
	
	
    </style>
	
	</head>
	<body class="chat_page">
		<div class="top">
			<div class="bgImg">
				<img src="{$_C.hy_path}images/chat/top.png">
			</div>
			{if $info.headimgurl}
			<div class="perImg">
				<img src="{$info.headimgurl}">
			</div>
			{/if}
		</div>
		
		
		   <div class="swiper-container">
        <div class="swiper-wrapper">
        	{foreach from=$carousel key=key item=banner}
					
						
				
            <div class="swiper-slide" id="carousel_a_{$key+1}"  onclick = "addClickAd('{$banner.id}','{$banner.url}')" >
            		<img id="carousel_img_{$key+1}" src="http://g4.shfyuan.com/ws/{$banner.pic_path}" width="100%">
            </div>
			{/foreach}
        </div>
        <!-- Add Pagination -->
        <div class="swiper-pagination"></div>
        <!-- Add Arrows -->
      
    </div>
	
		<div class="chat" id="chat_bus">
		</div>
			<ul class="send-msg">
				<li><img src="{$_C.hy_path}images/chat/face.png"></li>
				<li><input  type="text" id="commont" placeholder="{$placeholder}"></li>
				<li><button onClick="sendComment()"><img src="{$_C.hy_path}images/chat/chat_send.png" alt=""></button></li>
			</ul>
		<div class="mask_zzc"></div>
	    <div class="alert" id="alert2" style="padding:15px">
			
				<div id="msg" class="fs3"></div>
				<a href="javascript:void(0)" class="alert-btn fc1 fs3">确定</a>
				
		</div>
		<div class="modal">
			<div class="modal_zzc"></div>
			<div class="modal_panel" id="prize">
				<img src="{$_C.hy_path}images/chat/award_pop.png" alt="" class="award_box">
				<img src="{$_C.hy_path}images/chat/award_paper.png" alt="" class="award_paper">
				<img src="{$_C.hy_path}images/chat/award_title1.png" alt="" class="award_title">
				<div class="modal_panel_inner">
					<h4 id="prize_name">恭喜你，获取XXX奖</h4>
					<img id="prize_img" src="{$_C.hy_path}images/chat/award_img.png" alt="">
					<a>去领奖</a>
				</div>
			</div>
			<div class="modal_panel hide" id="noPrize">
				<img src="{$_C.hy_path}images/chat/award_pop.png" alt="" class="award_box">
				<img src="{$_C.hy_path}images/chat/award_paper.png" alt="" class="award_paper">
				<div class="modal_panel_inner">
					<h4 id="noPrize" >没有中奖，谢谢参与</h4>
					<!--<img id="noPrize_img" src="{$_C.hy_path}images/chat/award_img.png" alt="">-->
					<a>谢谢参与</a>
				</div>
			</div>
			<div class="modal_panel hide" id="info">
				<img src="{$_C.hy_path}images/chat/contact.png" alt="" class="award_box">
				<div class="modal_panel_inner">
					<h4>请填写联系方式</h4>
					<input type="text" id="name" placeholder="姓名">
					<input type="text" id="phone" placeholder="手机号码">
					<a>提交</a>
				</div>
			</div>
			<div class="modal_panel hide" id="warn">
				<img src="{$_C.hy_path}images/chat/award_pop.png" alt="" class="award_box">
				<img src="{$_C.hy_path}images/chat/award_paper.png" alt="" class="award_paper">
				<div class="modal_panel_inner">
					<h4 id="warn_content" style="margin: 4% 17% 4% 16%;">没有中奖，谢谢参与</h4>
					<a id="warn_a">谢谢参与</a>
				</div>
			</div>
		</div>
    	<script type="text/javascript" src="{$_C.hy_path}js/jquery-1.10.2.min.js"></script>
    	<script type="text/javascript" src="{$_C.hy_path}js/bootstrap.min.js"></script>
    	<script type="text/javascript" src="{$_C.hy_path}js/bd-touch.js"></script>
		<script type="text/javascript">
			var timestamp;//用于防止多次评论
			//var timtout = parseInt('{$timeout}')*1000;
			var refreshtime = parseInt('{$refreshtime}')*1000;
			var wxid = '{$info.id}';
			var imgurl = '{$info.headimgurl}';
			var now  = parseInt('{$now}')*1000;//刚登陆的时间
			var number  = 0;//用户评论的次数
			var rule = eval('{$rule1}');
		 	var rule2 = eval('{$rule2}');
		 	var rule3 = eval('{$rule3}');
		 	var rule4 = eval('{$rule4}');
			var specialAd = eval('{$specialAd}');
			var carouselAd = eval('{$carouselAd}');
			var refreshtimestamp = parseInt('{$timestamp}');
			var timtout = ((refreshtime/1000)-((now/1000)-refreshtimestamp)%(refreshtime/1000))*1000;
			var commentMinuteMax = parseInt('{$commentMinuteMax}');
			var commentDayMax = parseInt('{$commentDayMax}');
			var commentDayNum = parseInt('{$commentDayNum}');//当前当天用户评论的数量
			var chatMaxNum = parseInt('{$chatMaxNum}');//发言字数限制
			var staggerTime = parseInt('{$staggerTime}');//错位时间
			
		</script>
		<script type="text/javascript" src="{$_C.hy_path}js/chat_index.js"></script>
		<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
		
    <script src="{$_C.hy_path}js/swiper.min.js"></script>

    <script>
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
       autoplay: 2000,
        slidesPerView: 1,
        paginationClickable: true,
        spaceBetween: 30,
        loop: true
    });
			 var pid = "{$info.wxid|default:'0'}";
				  wx.config({
				    debug: false, 
				    appId: '{$signPackage.appId}',
				    timestamp: {$signPackage.timestamp},
				    nonceStr: '{$signPackage.nonceStr}',
				    signature: '{$signPackage.signature}',
				    jsApiList: [
				      // 所有要调用的 API 都要加到这个列表中
				      'onMenuShareTimeline',
				      'onMenuShareAppMessage'
				    
				    ]
				  });
				
				  wx.ready(function () {
				  	
		    wx.onMenuShareTimeline({
		    
		    title: '邀请您一起玩POCO弹幕还有更多惊喜哦',
		     link:'http://g4.shfyuan.com/ws/index.php?g=mobile&m=chat&a=index&pid='+pid,
		     imgUrl: 'http://g4.shfyuan.com/ws/Mobile/Webroot/gf/images/chat/share.png',
		      trigger: function (res) {
		       
		      },
		      success: function (res) {
		    	  document.getElementById('mcover').style.display='';
					showMsg("分享成功。");
		      },
		      cancel: function (res) {
		       
		      },
		      fail: function (res) {
		        alert(JSON.stringify(res));
		      }
		    });
		    
			wx.onMenuShareAppMessage({
		    link:'http://g4.shfyuan.com/ws/index.php?g=mobile&m=chat&a=index&pid='+pid,
		     title: 'POCO弹幕',
		    desc: '{$info.name}邀请您一起玩POCO弹幕还有更多惊喜哦！',
		  	imgUrl: 'http://g4.shfyuan.com/ws/Mobile/Webroot/gf/images/chat/share.png',
		    success: function () { 
		    	document.getElementById('mcover').style.display='';
		    	showMsg("分享成功。");
		    },
		    cancel: function () { 
		        // 用户取消分享后执行的回调函数
		    }
		});
				 function flgSubmitInfo(){
					 
					 var url = "/index.php?g=home&m=safe&a=flgSubmitInfo";
						$.post(url,"",function(res){
							console.info(res);
							if(res=='ok'){
								document.getElementById('mcover').style.display='block';
							}else{
								window.location.href='/index.php?g=home&m=safe&a=share';
							}
						},"text");
				 }
				
			
		
		  });
		  </script>
	</body>
</html>
